package Character_Stream;

import java.io.*;

public class IO_Demo08 {
    public static void main(String[] args) {
//        使用字符流来读取文件内容
        try(Reader reader = new FileReader("./text4.txt")){
            while (true) {
                char[] buffer = new char[1024];
                int n = reader.read(buffer);
                if (n == -1){
                    break;
                }
                String s = new String(buffer,0,n);
                System.out.println(s);
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
